package com.jeesite.modules.ocr.adapter;

import com.jeesite.modules.ocr.base.IOcrAlgorithmConfig;
import com.jeesite.modules.ocr.base.IOcrResult;

public class OcrResultFactory {

	public static IOcrResult getOcrResult(IOcrAlgorithmConfig ocrAlgorithmConfig) {
		//默认使用本地百度引擎
		IOcrResult iOcrResult;
		switch (ocrAlgorithmConfig.getModelVersion()) {
		case "ONNX_PPOCR_V3	":
			iOcrResult=new PaddleOcrResultAdapter();
			break;
		case "ONNX_PPOCR_V4":
			iOcrResult=new PaddleOcrResultAdapter();
			break;
		case "华为OCR-通用文字识别":
			iOcrResult=new PanGuAiKitsOcrResultAdapter();
			break;
		case "华为OCR-通用表格识别":
			iOcrResult=new PanGuAiKitsOcrResultAdapter();
			break;
		default:
			iOcrResult=new PaddleOcrResultAdapter();
			break;
		}
		return iOcrResult;
	}
}
